package com.aegis.common.master.sr.config;

import cn.hutool.json.JSONUtil;
import com.aegis.common.master.redis.listener.MasterChangeListener;
import com.aegis.common.master.redis.model.NodeInfo;
import lombok.extern.slf4j.Slf4j;

/**
 * @Author wuweixin
 *
 * @Version 1.0
 * @Descritube
 */
@Slf4j
public class DefaultMasterChangeListener implements MasterChangeListener {
    @Override
    public void change(boolean isMaster, NodeInfo masterInfo) {
        log.info("主节点发生变化，当前节点是否为主节点：{} -- 主节点信息：{}", isMaster, JSONUtil.toJsonStr(masterInfo));
    }
}
